home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 171
/
171.d81
/
b.spiral slide
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
10KB
|
276 lines
10 poke56,56:clr:dv=peek(186):ifdv<8ordv>29thendv=8
12 poke788,49:tq=ti
14 poke53281,0:poke53280,0:print"[147]":gosub60000
20 sys57812"spiral font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
22 ifti<tq+100then22
30 poke53272,31
100 gosub 1000: rem initialize
110 gosub 2000: rem instructions
120 gosub 3000: rem conditions, board
130 on m goto 140,140,180,180
140 gosub 5000: rem player move
150 if jk=1 then 7200:rem stopped
160 jj=hh: gosub 8000: if em=0 then on w goto 7000,7100: rem game won/lost
170 y=5-y: on m goto 180,140,180,110
180 gosub 6000: rem computer move
190 if jk=1 then 7200: rem stopped
200 jj=hh: gosub 8000: if em=0 then on w goto 7000,7100: rem game won/lost
210 y=5-y: on m goto 140,110,140,180
1000 dimm%(38,2),a%(3),b%(3,5),s$(5),d$(1):rem poke808,225:poke818,32
1010 poke53371,0:fori=1to38:readm%(i,0):readm%(i,1):next
1020 data10,13,10,15,12,15,14,15,14,13,14,11,14,9,14,7,12,7,10,7,8,7,6,7,6,9
1030 data6,11,6,13,6,15,6,17,6,19,8,19,10,19,12,19,14,19,16,19,18,19,18,17
1040 data18,15,18,13,18,11,18,9,18,7,18,5,18,3,16,3,14,3,12,3,10,3,8,3,6,3
1050 b$=" [157][157][157][157][157][157][157][157][157][157][157][157]":b1$=b$+b$+b$+b$+b$+b$+b$+b$+b$
1060 fori=0to5:reads$(i):next
1070 data"[195][207][205][208][213][212][197][210] 2","[208][204][193][217][197][210] ","[208][204][193][217][197][210] 1 ","[208][204][193][217][197][210] 2 ","[195][207][205][208][213][212][197][210] "
1080 data"[195][207][205][208][213][212][197][210] 1"
1090 m=1:w=1:sm=1:d$(0)="[167][170][157][157][181][175]":d$(1)="[171][178][157][157][174][163]":return
2000 poke53280,0:poke53281,0:printchr$(14);chr$(8);:rem by floyd r. kirk
2010 print"[147]";tab(12);"[158][188][172][157][157][177][187][157][157][165][180][145][208][201][210][193][204] [145][188][172][157][157][177][187][157][157][165][180][145][204][201][196][197][154]"
2020 print" [217]ou determine the initial layout of"
2030 print"the board by placing several coins in a"
2040 print"series of boxes connected in a spiral,"
2050 print"one coin to a box. [193]fter the coins are"
2060 print"placed, you and the computer alternate"
2070 print"sliding any one coin toward the center,"
2080 print"up to but not on or past the next coin"
2090 print"or the center of the spiral. [212]he game"
2100 print"ends when no further moves are possible.";
2110 print" [217]ou decide whether the one making the"
2120 print"last move wins or loses, who moves"
2130 print"first, and how many coins are set in"
2140 print"which boxes. [207]n your turn, move using"
2150 print"the left and right cursor keys, then"
2160 print"select a square; the immediate outside"
2170 print"coin will slide in to that square."
2180 print" [195]an't beat the computer? [212]hen switch"
2190 print"sides, play against another person, or"
2200 print"watch the computer play itself."
2210 print" [159][208]ress a key";:poke198,0
2220 geta$:ifa$=""then2220
2230 return
3000 poke53280,12:poke53281,12
3005 print"[147]";tab(12);"[158][188][172][157][157][177][187][157][157][165][180][145][208][201][210][193][204] [145][188][172][157][157][177][187][157][157][165][180][145][204][201][196][197]"
3010 print" [205]oves 1st vs. [205]oves 2nd"
3012 print" [144][185][185][185][185][185][185][185][185][185][185][185][185] [185][185][185][185][185][185][185][185][185][185][185][185] f1 [195]hange"
3015 print"[144][161] [162][161] [162] players.";
3017 print" [144][182][182][182][182][182][182][182][182][182][182][182][182] [182][182][182][182][182][182][182][182][182][182][182][182]"
3020 print"[196]oes the one who makes":print"the last move win or":print"lose?"
3022 printtab(7);"[144][185][185][185][185][185][185]";tab(29);"f3 [195]hange"
3025 printtab(6);"[144][161] [162]";tab(32);"last"
3027 printtab(7);"[144][182][182][182][182][182][182]";tab(32);"move."
3030 print"[215]ho puts the coins":print"on the board?"
3032 print" [144][185][185][185][185][185][185][185][185][185][185]";tab(29);"f5 [195]hange"
3035 print" [144][161]"tab(14);"[162]";tab(32);"coin"
3037 print" [144][182][182][182][182][182][182][182][182][182][182]";tab(32);"layer."
3040 printtab(29);"f7 [196]one."
3050 y=m-(m>2):r=6:c=2:gosub9000:prints$(y);""s$(5-y)
3060 r=12:c=8:gosub9000:ifw=1thenprint"[215][201][206] ":goto3070
3065 print"[204][207][211][197]"
3070 r=17:c=5:gosub9000:printleft$(s$(sm),8):poke198,0
3080 geta$:ifa$=""then3080
3090 ifa$="[135]"thensm=5-sm:goto3070
3095 ifa$="[134]"thenw=3-w:goto3060
3100 ifa$="[136]"then3120
3105 ifa$<>"[133]"then3080
3110 m=m+1:ifm=5thenm=1
3115 goto3050
3120 gosub4000:ifsm=4then3500
3121 r=5:c=27:gosub9000:print"3 coins.":printtab(27);"[208]ress [176] or [191]"
3123 printtab(27);"to move":printtab(27);"white box."
3124 printtab(27);"f7 [208]ick up":printtab(30);"or drop":printtab(30);"a coin."
3126 printtab(27);"f1 [196]one."
3128 print"";tab(27);:ifm=1thenprint"[217]ou have":goto3130
3129 print"[195]omputer has"
3130 printtab(27);"first move.":printtab(27);"[204]ast move":printtab(27);
3132 ifw=1thenprint"wins.":goto3135
3133 print"loses."
3135 cn=3:i=1:r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));""
3140 ch$="[157][136][133]":poke198,0
3150 geta$:ifa$=""thengosub9100:goto3150
3160 jl=0:forj=1to4:ifa$=mid$(ch$,j,1)thenjl=j:j=4
3170 next:ifjl=0then3150
3180 onjlgoto3200,3250,3300,3350
3200 il=i:i=i-1:ifi=0theni=38
3210 r=m%(il,0):c=m%(il,1):gosub9000:print"";d$(m%(il,2))
3220 r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));"":goto3150
3250 il=i:i=i+1:ifi=39theni=1
3260 goto3210
3300 ifcn<1andm%(i,2)=0then3150
3310 m%(i,2)=1-m%(i,2):ifm%(i,2)=0thencn=cn+1:goto3330
3320 cn=cn-1
3330 print"";tab(26);cn;"coin [157][157]";:ifcn<>1thenprint"s";
3340 print".":r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2));"":goto3150
3350 r=5:c=27:gosub9000:printb1$;"[145]";b1$
3355 r=m%(i,0):c=m%(i,1):gosub9000:print"";d$(m%(i,2))
3360 hh=0:jj=38:gosub8000:ifem>0thenpoke53280,0:poke53281,0:return
3370 r=7:c=27:gosub9000:print"[212]oo simple!"
3380 printtab(27);"[212]ry again.":poke198,0
3390 forj=1to38:m%(j,2)=0:next:poke53370,0
3400 forj=1to500:geta$:ifa$<>""thenj=500
3410 next:poke53371,0:goto3120
3500 i=int(rnd(0)*2)+2
3510 j=int(rnd(0)*37)+2:ifm%(j,2)=1then3510
3520 r=m%(j,0):c=m%(j,1):gosub9000:print"";d$(1):m%(j,2)=1:i=i-1:ifi>0then3510
3530 r=22:c=27:gosub9000:print"[204]ast move":printtab(27);
3540 ifw=1thenprint"wins.":goto3360
3550 print"loses."
3560 goto3360
4000 print"[147]"tab(30)"[158][188][172][208][201][210][193][204]"
4010 printtab(16)"[198]loyd [203]irk's [158][177][187]"
4020 printtab(30)"[158][165][180][204][201][196][197]":print:print
4030 print" [167][170] [167][170][167][170][167][170][167][170][167][170][167][170][167][170]"
4040 print" [181][175] [181][175][181][175][181][175][181][175][181][175][181][175][181][175]"
4050 print" [167][170] [167][170] [167][170]"
4060 print" [181][175] [181][175] [181][175]"
4070 print" [167][170] [167][170] [158][184][184][167][170][167][170] [167][170]"
4080 print" [181][175] [181][175] [158][184][184][181][175][181][175] [181][175]"
4090 print" [167][170] [167][170] [167][170] [167][170]"
4100 print" [181][175] [181][175] [181][175] [181][175]"
4110 print" [167][170] [167][170][167][170][167][170][167][170][167][170] [167][170]"
4120 print" [181][175] [181][175][181][175][181][175][181][175][181][175] [181][175]"
4130 print" [167][170] [167][170]"
4140 print" [181][175] [181][175]"
4150 print" [167][170][167][170][167][170][167][170][167][170][167][170][167][170][167][170][167][170]"
4160 print" [181][175][181][175][181][175][181][175][181][175][181][175][181][175][181][175][181][175]"
4170 return
5000 r=5:c=27:gosub9000:print"";s$(y);"":i=1:jk=0
5002 ifm%(i,2)=1theni=i+1:goto5002
5005 print:printtab(27);:ifem=1thenprintb$:goto5020
5010 print"[154][208]ress [176][154] or [191][154]":printtab(27);"to move":printtab(27);"white box."
5020 r=11:c=27:gosub9000:print"f7[154] [211]elect":printtab(30);"square."
5022 ifm=1orm=3thenprint:printtab(27);"f2[154]